<template>
  <k-view class="score-read-poup">
    <k-view class="score-read-poup-body">
      <k-text class="read-poup-title" v-if="title">{{ title }}</k-text>
      <k-view class="read-poup-content">
        <k-text class="content-text">{{ content }}</k-text>
        <k-text v-if="linkText" @click.stop="goIntro" class="more-link">{{ linkText }}</k-text>
      </k-view>
    </k-view>
    <k-view class="score-read-poup-arrow"></k-view>
  </k-view>
</template>

<script>
import { jumpByUrl } from '@/utils';

export default {
  props: {
    title: {
      type: String,
      default: '弹出层标题',
    },
    content: {
      type: String,
      default: '弹出层内容',
    },
    linkText: {
      type: String,
      default: '查看更多',
    },
    linkId: {
      type: String,
      default: '查看更多',
    },
    bottom: {
      type: String,
      default: '162px',
    },
    left: {
      type: String,
      default: '0',
    },
    width: {
      type: String,
      default: '100%',
    },
  },
  methods: {
    goIntro() {
      jumpByUrl({ name: 'intro', query: { id: this.linkId } });
    },
  },
};
</script>

<style lang="less">
.score-read-poup {
  position: absolute;
  width: v-bind(width);
  padding-bottom: 32px;
  bottom: v-bind(bottom);
  left: v-bind(left);
  .score-read-poup-body {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    box-sizing: border-box;
    border-radius: 8px;
    .read-poup-title {
      font-size: 28px;
      color: #ffffff;
      font-weight: 500;
    }
    .read-poup-content {
      text-align: left;
      .content-text {
        display: inline;
        font-size: 28px;
        color: #ffffff;
        font-weight: 400;
      }
      .more-link {
        display: inline;
        font-size: 28px;
        color: #538bf9;
        text-decoration: underline;
      }
    }
  }
  .score-read-poup-arrow {
    width: 0;
    height: 0;
    position: absolute;
    bottom: 2px;
    left: 116px;
    border: 16px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.7);
  }
}
</style>
